package com.loopy.jdbc.Jdbc01;

import com.loopy.jdbc.myjdbc.MysqlJdbcImpl;
import com.mysql.jdbc.Driver;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;

public class Jdbc01 {
    public static void main(String[] args) throws SQLException {

            Driver driver = new Driver();
            String url="jdbc:mysql://localhost:3306/testdb";
        Properties properties = new Properties();
        properties.setProperty("user","root");
        properties.setProperty("password","123456");
        Connection connect = driver.connect(url, properties);
        String sql="insert into actor values(null,'刘德华','男','1970-01-02','110')";
        Statement statement = connect.createStatement();
        int rows = statement.executeUpdate(sql);
        System.out.println(rows>0?"成功":"失败");
        statement.close();
        connect.close();


    }
}
